{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "dc830365-2b7d-42c1-9fa3-d1a9d108bf77",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "方程x* x -10*x + 16 = 0 的解为： 8.0 2.0\n"
     ]
    }
   ],
   "source": [
    "#chapter02\\module1.py\n",
    "#求解方程x* x -10*x + 16 = 0 \n",
    "import math\n",
    "a = 1; b = -10; c = 16\n",
    "x1 = (-b + math.sqrt(b*b - 4*a*c))/(2*a)\n",
    "x2 = (-b - math.sqrt(b*b - 4*a*c))/(2*a)\n",
    "print('方程x* x -10*x + 16 = 0 的解为：', x1, x2)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ba2b9c9d-98f6-47fa-a8f6-e5e46c38c786",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
